package com.flitsneak.designpatterns.behavioralpatterns.memento;

/**
 * @author flitsneak
 * @email flitsneak@gmail.com
 * @date 2022/7/19 14:10
 * @description
 */
public class FeiFei {
    public static void main(String[] args) {
        LickDogDiary lickDogDiary = new LickDogDiary();
        LickDogFeiFei lickDogFeiFei = new LickDogFeiFei("帮忙取快递", "得到了女神的微笑！");
        LickDogMemento memento = lickDogFeiFei.createMemento();
        lickDogDiary.addMemento(memento);
        System.out.println(lickDogFeiFei.getEvent()+"-----"+lickDogFeiFei.getEffect());

        lickDogFeiFei.setEvent("嘲讽女神的安神花心");
        lickDogFeiFei.setEffect("获得女神的拉黑！");
        System.out.println(lickDogFeiFei.getEvent()+"-----"+lickDogFeiFei.getEffect());

        LickDogMemento dogDiaryMemento = lickDogDiary.getMemento();
        lickDogFeiFei.restoreMemento(dogDiaryMemento);
        System.out.println(lickDogFeiFei.getEvent()+"-----"+lickDogFeiFei.getEffect());
    }
}
